package com.lgx.right.dao;

import java.util.List;

import com.lgx.common.exception.DataException;
import com.lgx.common.tree.easyui.TreeModel;
import com.lgx.common.web.Pagination;
import com.lgx.right.entity.Role;

public interface IRoleDao {

	public Role createRole(Role role)throws DataException;
	public Role updateRole(Role role)throws DataException;
	public void deleteRole(Role role)throws DataException;
	public void deleteRole(long id)throws DataException;
	
	public Role findRoleById(long id);
	
	public List<Role> findRoleList(String sql);
	
	public List<Role> findRoleList(String sql,Object[] params,int pageSize,int pageNum);
	public Pagination findRolePagination(String sql,Object[] params,int pageSize,int pageNum);
	
	public Pagination findRolePagination(Object[] params,int pageSize,int pageNum);
	
	public void deleteRoles(String[] ids)throws DataException;
	
	/**
	 * 根据userId查找它的角色
	 * @param userID
	 * @return
	 */
	public List<TreeModel> findRoleUserTreeList(long userId); 
	
	public List<Role> findRoleListByIds(String ids);
}
